package ludowork.components;

import java.util.ArrayList;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import ludowork.core.ImageSource;
import ludowork.core.VisorPlugin;

public class VisorMenuBar extends JMenuBar {

    public VisorMenuBar() {
        file = new JMenu("File");
        transform = new JMenu("Transform");
        help = new JMenu("Help");
        this.add(file);
        this.add(transform);
        this.add(help);
        
    }
    public void generateFileMenu(ArrayList<VisorPlugin> visorPlugins) {
        for (VisorPlugin visorPlugin : visorPlugins) {
            JMenuItem item = new JMenuItem((visorPlugin).getMenuName());
            item.addActionListener(new PluginActionListener(visorPlugin));
            file.add(item);
        }
    }
    
    private JMenu file;
    private JMenu transform;
    private JMenu help;
}
